<template>
	<div>
		<top-nav bgColor="white" title="线上订单"  btnName="新增"  :rightShow="true" returnPath="factoryList"  @rightDo="goAddBills"></top-nav>
		
		<div style="width: 100%;height: 3rem;"></div>
		<mu-checkbox label="所有订单" class="demo-checkbox"  v-model='checkdshowclose' @change="checkbox" />
        <div v-show="showList">
		   	<div style="padding:0.4rem 0.6rem;" @click="sendParams(item)" v-for="item in list">
		   		<section style="width: 100%;display: flex;flex-direction: column;background-color: white;">
		   			<section style="justify-content: left;align-items: center;display: flex;flex-direction: row;height: 2.8rem;padding: 0 0.5rem;">
		   				<span style="flex: 7;text-align: left;font-size: 1.1rem;">订单编号：{{item.BillNo}}</span>
		   				<mu-icon style="flex: 1;" value="keyboard_arrow_right" :size="26"/>
		   			</section>
		   			<section style="display: flex;flex-direction: column;justify-content: center;justify-content: left;padding: 0 0.5rem;">
		   					<span  class="card-item-child">物料名称：{{item.ItemName}}</span>
		   				<span  class="card-item-child">客户名称：{{item.CustomName}}</span>
		   <!--				<span class="card-item-child">编号：{{CustomNumber}}</span>-->
		   <!--				<span class="card-item-child">：{{materiel}}</span>-->
		   				<span class="card-item-child">订单数量：{{item.Qty}}</span>
		   <!--				<span class="card-item-child">备注：{{BillNo}}</span>-->
		   			</section>
		   			<mu-divider></mu-divider>
		   		</section>
		   	</div>
		   
		   
		   
           </div>
     	<div v-show="!showList">
		<mu-circular-progress :size="24" color="blue500"/>
		</div>	
        
<div style="width: 100%;height: 8rem;"></div>
	</div>
</template>

<script>
	 export default {
		data(){
			return{
				//loading1:false,
				list:[],
				checkdshowclose:false,
				showList:false,
			}
		},
		mounted(){
			console.info(this.list)
			
			this.getAppOrderList()
			
			
		},
		methods:{
			sendParams(item){
				let that=this
				//this.$emit('faSendParam','')
				that.$router.push(
				{path:'hongchangGrantBillsForm',
				name:'hongchangGrantBillsForm',
				 params: { 
			        ID:item.ID,
			        data:item.item
			    }})
			},
			
			goAddBills(){
				let that=this
				that.$router.push({
					path:'/hongchangAddGrantBills'
				})
			},
			getAppOrderList(){
				let that=this
				let showclose
				if(that.checkdshowclose){
				showclose=0
				}else
				{
				showclose=1
				}
				that.axios.post(that.global.hangchangSrc+'/hongchang/getAppOrderList',{
					'factoryId':localStorage.factoryId,
					'uid':localStorage.uid,
					'showclose':showclose
				}).then(function(response){
					console.info(response.data.data)
					that.showList=true 
					that.list=response.data.data.list
				}).catch(function(error){
					
				})
				//that.showList=true 
			},
			checkbox()
			{
				this.getAppOrderList()
			}
	 		}
	}
</script>

<style>
		.card-item-child{
		text-align: left;
		font-size: 0.9rem;
		height: 1.6rem;
		color: #939393;
	}
</style>